<!--
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/order/orderform/OrderForm.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/order/orderform/OrderForm.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '计划单',
                name: 'orderform/OrderForm',
                url: "/OrderForm/",
                sortName: "AcquisitionTime",
                foreignKey:null
            });
            const editFormFields = ref({"OrderNumber":"","SteelGrade":"","RequiredWeight":"","AcquisitionTime":"","PlannedHeatNumber":"","ActualHeatNumber":"","ActualProducedWeight":"","ProductionFrequency":"","Status":"","AllocationUserTime":""});
            const editFormOptions = ref([[{"title":"订单编号","field":"OrderNumber"},
                               {"title":"钢种","field":"SteelGrade"},
                               {"title":"需求重量","field":"RequiredWeight"}],
                              [{"title":"订单获取时间","field":"AcquisitionTime","type":"datetime"},
                               {"title":"计划炉号","field":"PlannedHeatNumber"},
                               {"title":"实际炉号","field":"ActualHeatNumber"}],
                              [{"title":"实际已生产重量","field":"ActualProducedWeight"},
                               {"title":"已生产炉次","field":"ProductionFrequency","type":"number"},
                               {"dataKey":"计划单状态","data":[],"title":"订单状态","field":"Status","type":"select"}],
                              [{"title":"炉号分配时间","field":"AllocationUserTime","type":"datetime"}]]);
            const searchFormFields = ref({"OrderNumber":""});
            const searchFormOptions = ref([[{"title":"订单编号","field":"OrderNumber"}]]);
            const columns = ref([{field:'Id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'OrderNumber',title:'订单编号',type:'string',link:true,width:150,align:'left',sort:true},
                       {field:'SteelGrade',title:'钢种',type:'string',width:110,align:'left'},
                       {field:'IngotShape',title:'锭形',type:'string',width:110,hidden:true,align:'left'},
                       {field:'RequiredWeight',title:'需求重量',type:'string',width:110,align:'left'},
                       {field:'AcquisitionTime',title:'订单获取时间',type:'datetime',width:180,align:'left',sort:true},
                       {field:'PlannedHeatNumber',title:'计划炉号',type:'string',width:100,align:'left'},
                       {field:'ActualHeatNumber',title:'实际炉号',type:'string',width:100,align:'left'},
                       {field:'ActualProducedWeight',title:'实际已生产重量',type:'string',width:110,align:'left'},
                       {field:'ProductionFrequency',title:'已生产炉次',type:'int',width:110,align:'left'},
                       {field:'Priority',title:'优先级',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Status',title:'订单状态',type:'int',bind:{ key:'计划单状态',data:[]},width:110,align:'left'},
                       {field:'ToMes',title:'回复ERP状态',type:'int',bind:{ key:'restatus',data:[]},width:110,hidden:true,align:'left'},
                       {field:'ToMesTime',title:'回复ERP时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'AllocationUserId',title:'炉号分配人ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'AllocationUserName',title:'炉号分配人',type:'string',width:110,align:'left'},
                       {field:'AllocationUserTime',title:'炉号分配时间',type:'datetime',width:180,align:'left',sort:true},
                       {field:'ModifyUserName',title:'修改人',type:'string',width:110,align:'left'},
                       {field:'ModifyUserId',title:'修改人ID',type:'string',width:110,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:180,align:'left',sort:true},
                       {field:'DeletionFlag',title:'删除标识',type:'int',bind:{ key:'enable',data:[]},width:110,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
